package org.paybiz.util;

import javax.servlet.http.HttpServletRequest;

/**
 * 请求工具类
 * @author nassir.wen
 * @date 2013-1-11上午10:29:39
 * @company: MSD. 
 * @copyright: Copyright (c) 2013
 */
public class RequestTools {

    /**
     * 获取完整的请求链接
     * @return
     */
    public static String getCompleteRequestUrl(HttpServletRequest request) {
        StringBuilder completeUrl = new StringBuilder();
        completeUrl.append(request.getScheme()).append("://").append(request.getServerName()).append(":")
                .append(request.getServerPort()).append(request.getContextPath()).append(request.getServletPath())
                .append("?").append(request.getQueryString());
        return completeUrl.toString();
    }
}
